BEGIN {
	#初始化设定packet被drop的数目
	highest_packet_id = 0;
	byBS = 0;
	byAP = 0;
	send_byAP = 0;
	WLAN0 = 0;
	WLAN1 = 0;
	from5to6plus = 0;
	from5to6recv = 0;
	sum_recvu_67 = 0;
	sum_recvu_68 = 0;
	from5to6 = 0;
	sum_drop = 0;
}
{
	#如果第5列是“---”,显然为WLAN网络的trace格式
	if($5 == "---") 
	{
		action = $1;
		time = $2;
		report_node = $3;
		layer = $4;
		packet_id = $6;
		packet_type = $7;
		packet_size = $8;
	}
	else
	{	action = $1;
		time = $2;
		from_node = $3;
		to_node = $4;
		packet_type = $5;
		packet_size = $6;
		seq_num = $11;
		packet_id = $12;
	}
	
	#记录下封包被发送的时间
	if(((action == "+") || (action == "s")) && packet_type == "cbr" && start_time[packet_id] == 0)
		start_time[packet_id] = time;
	#记录下封包被接收的时间
	if(action == "r" && from_node == 6 && to_node == 7 && end_time[packet_id] == 0)
		end_time[packet_id] = time;
	if(packet_id > highest_packet_id)
		highest_packet_id = packet_id;


}
END{
	for(i = 0; i < highest_packet_id; i++)
	{
		if(end_time[i] > start_time[i])
		{
			packet_duration[i] = end_time[i] - start_time[i];
			printf("%f %f\n", start_time[i], packet_duration[i])
		}
	}
	}

